//
//  MeHeaderTableViewCell.m
//  Job
//
//  Created by 桑赐相 on 2018/8/19.
//  Copyright © 2018年 桑赐相. All rights reserved.
//

#import "MeHeaderTableViewCell.h"
@interface MeHeaderTableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *avatarImage;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
@property (weak, nonatomic) IBOutlet UIView *loginView;
@property (weak, nonatomic) IBOutlet UILabel *unLoingLabel;

@end
@implementation MeHeaderTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self.avatarImage setLayerWithRadius:5.0 color:ClearColor width:0.0];
}

-(void)setUser:(XLUserModel *)user{
    _user = user;
    if (user) {
        self.loginView.hidden = NO;
        self.unLoingLabel.hidden = YES;
        [self.avatarImage sd_setImageWithURL:[NSURL URLWithString:user.portrait] placeholderImage:[UIImage imageNamed:@"def_header"]];
        self.nameLabel.text = user.name ? user.name : @"未填写";
        self.phoneLabel.text = [user.phone numberSuitScanf];
    }else{
        self.avatarImage.image = [UIImage imageNamed:@"def_header"];
        self.unLoingLabel.hidden = NO;
        self.loginView.hidden = YES;
    }
}




@end
